/*
 * Ext GWT - Ext for GWT
 * Copyright(c) 2007-2009, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
/*package com.hy.mydesktop.client.mvc;


import java.util.Map;

import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;
import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.google.gwt.user.client.rpc.AsyncCallback;


import com.test.client.component.event.AppEvents;
import com.test.client.component.mvc.event.EventStructureMetaModel;
import com.test.client.model.Folder;
import com.test.client.mvc.base.BaseController;

public class LoginController extends BaseController {

  private LoginView loginView;


  public LoginController() {
    
//    registerEventTypes(AppEvents.DESKTOP_UER_LOGIN);
    registerEventTypes(AppEvents.DESKTOP_USER_LOGIN);
    registerEventTypes(AppEvents.DESKTOP_UER_LOGIN_VALIDATE);
    registerEventTypes(AppEvents.Error);
  }

  public void handleEvent(AppEvent event) {
    EventType type = event.getType();
     if (type == AppEvents.DESKTOP_USER_LOGIN) {
    	 forwardToView(loginView, event);
    } 
     
     if (type == AppEvents.DESKTOP_UER_LOGIN_VALIDATE) {
    	 forwardToView(loginView, event);
    } 
     EventStructureMetaModel eventStructureMetaModel =(EventStructureMetaModel)((Map<String, Object>)event.getData()).get("eventstructuremetamodel");
		
		//0002
		if (AppEvents.DESKTOP_INIT_FOR_LOGGED_IN_USER==event.getType()) {
			//通过EventStructureMetaModel识别，是否应该处理该事件
			if (eventStructureMetaModel==null||eventStructureMetaModel.getControllerId()==null||eventStructureMetaModel.getControllerId()==this.getId()) {
				forwardToView(shortcutView, event);
				 this.forwardToChild(event);
			}
			 
		}; 
		
		
		*//**
		 * 将事件转发给子节点，及子控制器
		 * 注:当前控制器，含有子节点的时候，必不可少
		 *//*
		
  }

  public void initialize() {
    loginView = new LoginView(this);
  }

  protected void onError(AppEvent ae) {
    System.out.println("error: " + ae.<Object>getData());
  }
  
 
  

}*/
